This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
I have the following code in a xpage postSaveDocument event. It works fine.
var db:NotesDatabase = session.getDatabase(session.getServerName(), "TimeOffxp.nsf");
var agent:NotesAgent = db.getAgent;
agent.runOnServer(dominoDocument1.getNoteID());
Now, I want to add a condition so it only run when it is a new document. I tried the following codes and none of them seems work for me.
(1)
var db:NotesDatabase = session.getDatabase(session.getServerName(), "TimeOffxp.nsf");
var agent:NotesAgent = db.getAgent;
@If(@IsNewDoc()==1,agent.runOnServer(dominoDocument1.getNoteID()));
(2)
var db:NotesDatabase = session.getDatabase(session.getServerName(), "TimeOffxp.nsf");
var agent:NotesAgent = db.getAgent;
if(@IsNewDoc()==1){
agent.runOnServer(dominoDocument1.getNoteID());
}
Please advise what are the correct ways/formats to set if condition in xpage. Thanks.
Feedback number WEBB7UMRY9 created by ~John Prewetexoni on 08/05/2009
Status: Open
Comments: